home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 576-600 / 581 / prism / source / source.lzh / prism.h < prev    next >
C/C++ Source or Header  |  1991-11-17  |  11KB  |  481 lines

  1. /** PRISM .h file ... is included into Main Program. **
  2.  
  3. /************************** Sprite Defs *********************************/
  4. UWORD NormalCursor[] = 
  5. {
  6.     0,0,
  7.     0xf000, 0xf000,
  8.     0x0000, 0x0000,
  9.     0x0000, 0x0000,
  10.     0x0000, 0x0000,
  11.     0x0000, 0x0000,
  12.     0x0000, 0x0000,
  13.     0x0000, 0x0000,
  14.     0xf000, 0xf000,
  15.     0,0
  16. };
  17.  
  18. UWORD InterlaceCursor[]=
  19. {
  20.     0,0,
  21.     0xf000, 0xf000,
  22.     0x0000, 0x0000,
  23.     0x0000, 0x0000,
  24.     0xf000, 0xf000,
  25.     0,0
  26. };
  27.  
  28. UWORD ChipBlank[] =
  29. {
  30.     0,0,
  31.     0x0000, 0x0000,    0x0000, 0x0000,    0x0000, 0x0000,    0x0000, 0x0000,
  32.     0x0000, 0x0000,    0x0000, 0x0000,    0x0000, 0x0000,    0x0000, 0x0000,
  33.     0,0
  34. };
  35. WORD Spr1;
  36. /*************************** Gadget Definitions **************************/
  37. struct IntuiText Color15 ={0,15,JAM2,0,0,0," 15 ",0,};
  38. struct IntuiText Color14 ={0,14,JAM2,0,0,0," 14 ",0,};
  39. struct IntuiText Color13 ={0,13,JAM2,0,0,0," 13 ",0,};
  40. struct IntuiText Color12 ={0,12,JAM2,0,0,0," 12 ",0,};
  41. struct IntuiText Color11 ={0,11,JAM2,0,0,0," 11 ",0,};
  42. struct IntuiText Color10 ={0,10,JAM2,0,0,0," 10 ",0,};
  43. struct IntuiText Color9 ={0,9,JAM2,0,0,0,"  9 ",0,};
  44. struct IntuiText Color8 ={0,8,JAM2,0,0,0,"  8 ",0,};
  45. struct IntuiText Color7 ={0,7,JAM2,0,0,0,"  7 ",0,};
  46. struct IntuiText Color6 ={0,6,JAM2,0,0,0,"  6 ",0,};
  47. struct IntuiText Color5 ={0,5,JAM2,0,0,0,"  5 ",0,};
  48. struct IntuiText Color4 ={0,4,JAM2,0,0,0,"  4 ",0,};
  49. struct IntuiText Color3 ={0,3,JAM2,0,0,0,"  3 ",0,};
  50. struct IntuiText Color2 ={0,2,JAM2,0,0,0,"  2 ",0,};
  51. struct IntuiText Color1 ={0,1,JAM2,0,0,0,"  1 ",0,};
  52. struct IntuiText Color0 ={1,0,JAM2,0,0,0,"  0 ",0,};
  53.  
  54. struct IntuiText ForeBackText =
  55. {
  56.     15,0,JAM2,2,6,0,(UBYTE *)"Fore/Back",0
  57. };
  58. struct Gadget ForeBackGadget =
  59. {
  60.     0,560,10,76,19,
  61.     GADGHCOMP | SELECTED,RELVERIFY,BOOLGADGET,
  62.     0,0,&ForeBackText,0,0,17,0
  63. };
  64. struct Gadget SelColor15 =
  65. {
  66.     &ForeBackGadget,512,11,32,8,
  67.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  68.     0,0,&Color15,0,0,16,0
  69. };
  70.  
  71. struct Gadget SelColor14 =
  72. {
  73.     &SelColor15,478,11,32,8,
  74.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  75.     0,0,&Color14,0,0,15,0
  76. };
  77.  
  78. struct Gadget SelColor13 =
  79. {
  80.     &SelColor14,444,11,32,8,
  81.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  82.     0,0,&Color13,0,0,14,0
  83. };
  84.  
  85. struct Gadget SelColor12 =
  86. {
  87.     &SelColor13,410,11,32,8,
  88.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  89.     0,0,&Color12,0,0,13,0
  90. };
  91.  
  92. struct Gadget SelColor11 =
  93. {
  94.     &SelColor12,376,11,32,8,
  95.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  96.     
  97.     0,0,&Color11,0,0,12,0
  98. };
  99.  
  100. struct Gadget SelColor10 =
  101. {
  102.     &SelColor11,342,11,32,8,
  103.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  104.     0,0,&Color10,0,0,11,0
  105. };
  106.  
  107. struct Gadget SelColor9 =
  108. {
  109.     &SelColor10,308,11,32,8,
  110.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  111.     0,0,&Color9,0,0,10,0
  112. };
  113.  
  114. struct Gadget SelColor8 =
  115. {
  116.     &SelColor9,274,11,32,8,
  117.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  118.     0,0,&Color8,0,0,9,0
  119. };
  120.  
  121. struct Gadget SelColor7 =
  122. {
  123.     &SelColor8,240,11,32,8,
  124.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  125.     0,0,&Color7,0,0,8,0
  126. };
  127.  
  128. struct Gadget SelColor6 =
  129. {
  130.     &SelColor7,206,11,32,8,
  131.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  132.     0,0,&Color6,0,0,7,0
  133. };
  134.  
  135. struct Gadget SelColor5 =
  136. {
  137.     &SelColor6,172,11,32,8,
  138.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  139.     0,0,&Color5,0,0,6,0
  140. };
  141.  
  142. struct Gadget SelColor4 =
  143. {
  144.     &SelColor5,138,11,32,8,
  145.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  146.     0,0,&Color4,0,0,5,0
  147. };
  148.  
  149. struct Gadget SelColor3 =
  150. {
  151.     &SelColor4,104,11,32,8,
  152.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  153.     0,0,&Color3,0,0,4,0
  154. };
  155.  
  156. struct Gadget SelColor2 =
  157. {
  158.     &SelColor3,70,11,32,8,
  159.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  160.     0,0,&Color2,0,0,3,0
  161. };
  162.  
  163. struct Gadget SelColor1 =
  164. {
  165.     &SelColor2,36,11,32,8, 
  166.     GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
  167.     0,0,&Color1,0,0,2,0
  168. };
  169.  
  170. struct Gadget SelColor0 =
  171. {
  172.     &SelColor1,    /* NextGadget */
  173.     2,11,32,8,  /* LeftEdge, TopEdge, Width, Height*/
  174.     GADGHCOMP,  /* Flags */
  175.     RELVERIFY | GADGIMMEDIATE,   /* Activation */
  176.     BOOLGADGET,     /* Gadget Type */
  177.     0, /* Gadget Render */
  178.     0,       /* Select Render */
  179.     &Color0,       /* GadgetText */
  180.     0,          /* MutualExclude */
  181.     0,       /* SpecialInfo */
  182.     1,          /* GadgetID */
  183.     0        /* UserData */
  184. };
  185. /************************** Requester Definitions ************************/
  186. /***** The About Requester *****/
  187. struct IntuiText AboutProg7Text =
  188. {
  189.     4,7,JAM2,30,59,0,"Syd Bolton of Legendary Design Technologies Inc.",0
  190. };
  191. struct IntuiText AboutProg6Text =
  192. {
  193.     4,7,JAM2,30,50,0,
  194.     "Enhancements to this program by Chris Timmerberg, and",
  195.     &AboutProg7Text
  196. };
  197. struct IntuiText AboutProg5Text =
  198. {
  199.     4,7,JAM2,30,41,0,
  200.     "are not modified.  This version of Prism is public domain.",
  201.     &AboutProg6Text
  202. };
  203. struct IntuiText AboutProg4Text =
  204. {
  205.     4,7,JAM2,30,32,0,
  206.     "distributed as long as the original files in the archive",
  207.     &AboutProg5Text
  208. };
  209. struct IntuiText AboutProg3Text =
  210. {
  211.     4,7,JAM2,30,23,0,
  212.     "Prism is an ANSI animator for the Amiga.  It can be",
  213.     &AboutProg4Text
  214. };
  215. struct IntuiText AboutProgText =
  216. {
  217.     1,7,JAM1,205,9,0,"Prism by Colin Vernon",&AboutProg3Text
  218. };
  219. /***** The File Requester *****/
  220. UBYTE path[512] = "";
  221. UBYTE filename[33] = "Unnamed.ans";
  222.  
  223. /***** The Requester Window *****/
  224. struct NewWindow RequesterWindow =
  225. {
  226.     135,50,370,100,0,7,
  227.     GADGETUP,
  228.     SIMPLE_REFRESH | ACTIVATE,0,0,0,0,0,0,0,0,0,
  229.     CUSTOMSCREEN,
  230. };
  231. /***** The True Requester Definition *****/
  232. struct Requester FileSelectBox;
  233. /*************************************************************************/
  234. struct TextAttr WorkFont =
  235. {
  236.     (STRPTR)"ibm.font",
  237.     8, 0, 0
  238. };
  239. struct TextAttr DisplayFont =
  240. {
  241.     (STRPTR)"topaz.font", TOPAZ_EIGHTY, FS_NORMAL, FPF_ROMFONT
  242. };
  243. struct NewScreen FirstWorkScreen =
  244. {
  245.     0,0,        /* LeftEdge, TopEdge    */
  246.     640,210,    /* Width, Height    */
  247.     4,        /* Depth        */
  248.     4,7,        /* DetailPen, BlockPen    */
  249.     HIRES | SPRITES,/* ViewModes        */
  250.     CUSTOMSCREEN,    /* Type                */
  251.     &DisplayFont,    /* Font                   */
  252.     Titlebar,
  253.     0,        /* Gadgets        */
  254.     0,        /* CustonBitMap            */
  255. };
  256.  
  257. struct NewWindow FirstWorkWindow =
  258. {
  259.     0,10,        /* LeftEdge, TopEdge    */
  260.     640,200,    /* Width, Height    */
  261.     4,7,        /* DetailPen, BlockPen    */
  262.     MOUSEBUTTONS |    /* IDCMP Flags        */
  263.     RAWKEY |
  264.     MENUPICK,
  265.     SMART_REFRESH |    /* Flags        */
  266.     ACTIVATE |
  267.     BORDERLESS |
  268.     GIMMEZEROZERO,
  269.     0,           /* First Gadget         */
  270.     0,        /* CheckMark            */
  271.     0,        /* Window Title        */
  272.     0,        /* Screen        */
  273.     0,        /* BitMap        */
  274.     0,0,        /* Min Width, Height    */
  275.     0,0,        /* Max Width, Height    */
  276.     CUSTOMSCREEN,    /* Type                */
  277. };
  278.  
  279. struct NewWindow GadgetWindow =
  280. {
  281.     0,170,
  282.     640,30,
  283.     4,7,
  284.     GADGETUP | ACTIVEWINDOW,
  285.     SMART_REFRESH | WINDOWDRAG,
  286.     &SelColor0,
  287.     0,
  288.     "Gadget Box",
  289.     0,
  290.     0,
  291.     0,0,
  292.     0,0,
  293.     CUSTOMSCREEN
  294. };
  295.  
  296. struct InputEvent inputEvent =
  297. {
  298.     0,IECLASS_RAWKEY,0,0,0
  299. };
  300. UWORD AtrColors[16] =
  301. {
  302.     0x000, 0xA00, 0x0A0, 0xA60, 0x00A, 0xA0A, 0x0AA, 0xBBB,
  303.     0x666, 0xF00, 0x0F0, 0xFF0, 0x00F, 0xF0F, 0x0FF, 0xFFF    
  304. };
  305. /**************************** Menu Definition **************************/
  306. struct IntuiText ForplanesText =
  307. {
  308.     4,7,JAM2,18,1,&DisplayFont,"16 Colors",0
  309. };
  310. struct IntuiText ThreeplanesText =
  311. {
  312.     4,7,JAM2,18,1,&DisplayFont,"8 Colors",0
  313. };
  314. struct IntuiText TwoplanesText =
  315. {
  316.     4,7,JAM2,18,1,&DisplayFont,"4 Colors",0
  317. };
  318. struct IntuiText ColorsText =
  319. {
  320.     4,7,JAM2,0,1,&DisplayFont,"Colors",0
  321. };
  322. struct IntuiText QuitText =
  323. {
  324.     4,7,JAM2,0,1,&DisplayFont,"Quit",0
  325. };
  326. struct IntuiText AppendText =
  327. {
  328.     4,7,JAM2,0,1,&DisplayFont,"Append",0
  329. };
  330. struct IntuiText SaveText =
  331. {
  332.     4,7,JAM2,0,1,&DisplayFont,"Save",0
  333. };
  334. struct IntuiText LoadText =
  335. {
  336.     4,7,JAM2,0,1,&DisplayFont,"Load",0
  337. };
  338. struct IntuiText ClearText =
  339. {
  340.     4,7,JAM2,0,1,&DisplayFont,"Clear",0
  341. };
  342. struct IntuiText PlaybackText =
  343. {
  344.     4,7,JAM2,0,1,&DisplayFont,"Playback",0
  345. };
  346. struct IntuiText AboutText =
  347. {
  348.     4,7,JAM2,0,1,&DisplayFont,"About",0
  349. };
  350. struct IntuiText InterlaceText =
  351. {
  352.     4,7,JAM2,0,1,&DisplayFont,"   Lace",0
  353. };
  354. struct MenuItem Interlace =
  355. {
  356.     0, 0, 10, 110, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ|CHECKIT, 0,
  357.     (APTR)&InterlaceText, 0, 'I', 0, 0
  358. };
  359. struct MenuItem Forplanes =
  360. {
  361.     0,80,20,130,10,ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ|
  362.     CHECKIT|CHECKED,3,(APTR)&ForplanesText,0,'4',0,0
  363. };
  364. struct MenuItem Threeplanes =
  365. {
  366.     &Forplanes,80,10,130,10,ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ|
  367.     CHECKIT,5,(APTR)&ThreeplanesText,0,'3',0,0
  368. };
  369. struct MenuItem Twoplanes =
  370. {
  371.     &Threeplanes,80,0,130,10,ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ|
  372.     CHECKIT,6,(APTR)&TwoplanesText,0,'2',0,0
  373. };
  374. struct MenuItem Colors =
  375. {
  376.     &Interlace,0,0,110,10,ITEMTEXT | ITEMENABLED | HIGHCOMP,0,
  377.     (APTR)&ColorsText,0,0,&Twoplanes,0
  378. };
  379. struct MenuItem Quit =
  380. {
  381.     0,0,60,120,10,ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,0,
  382.     (APTR)&QuitText,0,'Q',0,0
  383. };
  384. struct MenuItem AppSave =
  385. {
  386.     0,80,10,60,10,ITEMTEXT | ITEMENABLED | HIGHCOMP,0,
  387.     (APTR)&SaveText,0,0,0,0
  388. };
  389. struct MenuItem AppLoad =
  390. {
  391.     &AppSave,80,0,60,10,ITEMTEXT | ITEMENABLED | HIGHCOMP,0,
  392.     (APTR)&LoadText,0,0,0,0
  393. };
  394. struct MenuItem Append =
  395. {
  396.     &Quit,0,50,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP,0,
  397.     (APTR)&AppendText,0,0,&AppLoad,0
  398. };
  399. struct MenuItem Save =
  400. {
  401.     &Append,0,40,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP | COMMSEQ,0,
  402.     (APTR)&SaveText,0,'S',0,0
  403. };
  404. struct MenuItem Load =
  405. {
  406.     &Save,0,30,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP | COMMSEQ,0,
  407.     (APTR)&LoadText,0,'L',0,0
  408. };
  409. struct MenuItem Clear =
  410. {
  411.     &Load,0,20,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP | COMMSEQ,0,
  412.     (APTR)&ClearText,0,'C',0,0
  413. };    
  414. struct MenuItem Playback =
  415. {
  416.     &Clear,0,10,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP | COMMSEQ,0,
  417.     (APTR)&PlaybackText,0,'P',0,0
  418. };
  419. struct MenuItem About =
  420. {
  421.     &Playback,0,0,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP,0,
  422.     (APTR)&AboutText,0,0,0,0
  423. };
  424. struct Menu Setup =
  425. {
  426.     0,
  427.     100,0,100,10,
  428.     MENUENABLED,
  429.     "Setup",
  430.     &Colors
  431. };
  432. struct Menu Project =
  433. {
  434.     &Setup,
  435.     0, 0, 100, 10,
  436.     MENUENABLED,
  437.     "Project",
  438.     &About
  439. };
  440.  
  441. UBYTE Buffer[MAXINPUTLEN];
  442. USHORT scanner;
  443. struct ANSI storage = { NULL,NULL,-1,-1,-1,-1,NULL };
  444. struct ANSI *sdlstptr, *lastptr, *middle, *front, *back;
  445. struct TextFont *TFont;
  446. USHORT length = 0,position = 0;    /* used to display where editor is */
  447. USHORT cx = 1, cy = 1;        /* cursor co-ordinates */
  448. USHORT maxheight=25;
  449. BOOL changes = FALSE;
  450. static UBYTE funckey[MAXCHARSETS][8] =
  451. {
  452.     {0xb3, 0xc4, 0xc5, 0xc0, 0xd9, 0xda, 0xbf, 0xd8},
  453.     {0xba, 0xcd, 0xce, 0xc8, 0xbc, 0xc9, 0xbb, 0xd7},
  454.     {0xc1, 0xc2, 0xb4, 0xc3, 0xca, 0xcb, 0xb9, 0xcc},
  455.     {0xbe, 0xd4, 0xb8, 0xd5, 0xbd, 0xd3, 0xb7, 0xd6},
  456.     {0xd0, 0xd2, 0xb6, 0xc7, 0xcf, 0xd1, 0xb5, 0xc6},
  457.     {0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xb0, 0xb1, 0xb2},
  458.     {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7},
  459.     {0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7},
  460.     {0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef},
  461.     {0xf0, 0xf1, 0xf2, 0xf3, 0xfe, 0xf6, 0xfd, 0xfb},
  462.     {0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf},
  463.     {0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfc}
  464. };
  465. long _stack = 10000;        /* my Load-And-Stay Resident stack size */
  466. UBYTE *_procname = "Prism";    /* my proceedure name */
  467. long _priority = 0;        /* A regular priority */
  468. long _BackGroundIO = 0;        /* If this != 0, I can Write() to CLI but
  469.                    I must Close(_Backstdout) when done */
  470. extern BPTR _Backstdout;    /* CLI file handle */
  471.  
  472. struct IntuiText GeneralText =
  473. {
  474.     1,0,        /* FrontPen, BackPen */
  475.     JAM2,       /* DrawMode */
  476.     0,0,        /* LeftEdge, TopEdge */
  477.     &WorkFont,  /* Font */
  478.     Buffer,
  479.     NULL
  480. };
  481.